require 'rubygems'
require 'sprout'
require 'task/swfmill'
require 'task/mtasc'
require 'task/flash_player'
include PatternPark

# NOTE: The generate tools will load this file
# and use these constants...
SRC_DIR             = 'src'
TEST_DIR            = 'test'
LIB_DIR             = 'lib/code'
BIN_DIR             = 'bin'
SKIN_DIR            = 'lib/skin'
DEFAULT_TEMPLATES   = ['as2']

############################################
# Launch the Application using Flash Player 8

task :run => [:compile_main]

# Assign this to the default task
task :default => [:run]

FlashPlayer.new(:run) do |t|
  t.version = 8
  t.swf = BIN_DIR + '/MiCalendar.swf'
end

############################################
# Launch the Test Suites using Flash Player 8

task :test => [:compile_tests]

FlashPlayer.new(:test) do |t|
  t.version = 8
  t.swf = BIN_DIR + '/MiCalendarRunner.swf'
end

############################################
# Compile your library using SWFMill

SWFMill.new(:compile_skin) do |t|
  t.input = SKIN_DIR + '/current'
  t.template = SKIN_DIR + '/SWFMillTemplate.erb'
  t.output = BIN_DIR + '/MiCalendarSkin.swf'
end

############################################
# Compile your Application using HAMTASC

task :compile_main => [:compile_skin]

MTASC.new(:compile_main) do |t|
  t.input = 'MiCalendar'
  t.main = true
  t.version = 7
  t.frame = 2
  t.header = '176:208:20'
  t.swf = BIN_DIR + '/MiCalendarSkin.swf'
  t.out = BIN_DIR + '/MiCalendar.swf'
  t.cp << SRC_DIR
end

############################################
# Compile your Application using HAMTASC

task :compile_tests => [:compile_skin]

MTASC.new(:compile_tests) do |t|
  t.input = 'MiCalendarRunner'
  t.version = 7
  t.frame = 2
  t.main = true
  t.swf = BIN_DIR + '/MiCalendarSkin.swf'
  t.out = BIN_DIR + '/MiCalendarRunner.swf'
  t.cp << SRC_DIR
  t.cp << TEST_DIR
  t.cp << LIB_DIR + '/asunit25'
end

############################################
